#include "stdinc.h"

void Main_UnprotectModule(HMODULE hMod)
{
	PIMAGE_DOS_HEADER header = (PIMAGE_DOS_HEADER)hMod;
	PIMAGE_NT_HEADERS ntHeader = (PIMAGE_NT_HEADERS)((DWORD)hMod + header->e_lfanew);
	SIZE_T size = ntHeader->OptionalHeader.SizeOfImage;
	DWORD oldProtect;
	VirtualProtect((LPVOID)hMod, size, PAGE_EXECUTE_READWRITE, &oldProtect);
}


bool __stdcall DllMain( HMODULE hModule, DWORD  dwReason, LPVOID lpReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
		Main_UnprotectModule(GetModuleHandle(NULL));
		Sys_RunInit();
	}
	return TRUE;
}

